﻿namespace Swimj.Core.Converter
{
    public class GenericTypeConverter<TIn, TOut> : SimpleFuncConverter
    {
        public GenericTypeConverter(Func<TIn, TOut> converterFunc, bool allowAssignableInputs)
            : base(typeof(TIn), typeof(TOut), o => converterFunc((TIn)o), allowAssignableInputs)
        {
        }

        public void SetConverterFunc(Func<TIn, TOut> fn)
        {
            base.SetConverterFunc(o => fn((TIn)o));
        }
    }
}